<?php
	$serviceId=$_POST['serviceId'];
	$roomId=$_POST['roomId'];
	$inputDate=$_POST['inputDate'];
	$outputDate=$_POST['outputDate'];
	$customerName=$_POST['customerName'];
	$phoneNumber=$_POST['phoneNumber'];
	$email=$_POST['email'];
	
	$inputDate = date('Y-m-d',strtotime($inputDate));
	$outputDate = date('Y-m-d',strtotime($outputDate));
	
	require_once('database.php');
	$link = connectDB();
	$sql = "insert into bookingroom(serviceId, unitId, startTime, finishTime, customerName, phoneNumber, email, status)
			values($serviceId, $roomId, '$inputDate', '$outputDate', '$customerName', $phoneNumber, '$email', 0)";
	//echo $sql;
	$result = mysql_query($sql,$link);
	$id=mysql_insert_id($link);
	header("Location: showinfo.php?id=$id");
?>